Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = /* */function () {
  function _class24() {
    babel_classCallCheck(this, _class24);
  }
  return babel_createClass(_class24, null, [{
    key: "isstring",
    value: function isstring(e) {
      return !!/^[a-zA-Z_]$/.test(e);
    }
  }, {
    key: "is_first",
    value: function is_first(e) {
      return !!/^_/.test(e);
    }
  }, {
    key: "decodeUtf8",
    value: function decodeUtf8(e) {
      var t = "";
      for (var _n43 = 0; _n43 < e.length; _n43++) {
        t += "%" + e[_n43].toString(16);
      }
      return decodeURIComponent(t);
    }
  }, {
    key: "encodeUtf8",
    value: function encodeUtf8(e) {
      var t = encodeURIComponent(e);
      var n = [];
      for (var o = 0; o < t.length; o++) {
        var _e42 = t.charAt(o);
        if ("%" === _e42) {
          var _e43 = t.charAt(o + 1) + t.charAt(o + 2);
          var i = parseInt(_e43, 16);
          n.push(i);
          o += 2;
        } else {
          n.push(_e42.charCodeAt(0));
        }
      }
      return n;
    }
  }, {
    key: "utf82str",
    value: function utf82str(e) {
      var t;
      var n = "";
      for (var o = 0; o < e.length; o++) {
        if (e.charCodeAt(o) >> 7 != 0) {
          if (e.charCodeAt(o) >> 5 != 6) {
            if (e.charCodeAt(o) >> 4 != 14) {
              if (e.charCodeAt(o) >> 3 != 31) {
                throw "不是UTF-8字符集";
              }
              t = (7 & e.charCodeAt(o + 0)) << 18 | (63 & e.charCodeAt(o + 1)) << 12 | (63 & e.charCodeAt(o + 2)) << 6;
              e.charCodeAt(o + 3);
              n += String.fromCharCode(t);
              o += 3;
            } else {
              t = (15 & e.charCodeAt(o + 0)) << 12 | (63 & e.charCodeAt(o + 1)) << 6 | (63 & e.charCodeAt(o + 2)) << 0;
              n += String.fromCharCode(t);
              o += 2;
            }
          } else {
            t = (31 & e.charCodeAt(o + 0)) << 6 | (63 & e.charCodeAt(o + 1)) << 0;
            n += String.fromCharCode(t);
            o++;
          }
        } else {
          n += e.charAt(o);
        }
      }
      return n;
    }
  }]);
}();